﻿using System;
using System.Collections.Generic;
using System.Text;
using Consul;

namespace MicroContainers.AspCore.Consul.HealthCheck
{
    public class HttpHealthCheckConfig : IHeathCheckConfig
    {
        public string Url { get; set; }

        public string Notes { get; set; }

        public int Timeout { get; set; } = 2;

        public int Interval { get; set; } = 10;

        public AgentCheckRegistration GetRegistration()
        {
            return new AgentCheckRegistration
            {
                HTTP = Url,
                Notes = Notes,
                Timeout = TimeSpan.FromSeconds(Timeout),
                Interval = TimeSpan.FromSeconds(Interval)
            };
        }
    }
}
